{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
{if $agora_config.o_rss_enabled}
{feed task=rss fid=$forum.id key=$agora_user.rss_id}
{/if}

<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">{$forum.forum_name}</span></h2>
</div>
{if $sub_forums}
<div id="sf" class="ag_tablewrap"> <!--Changed id from vf to sf Add Collapse ???-->
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
				<th class="ag_leftend">&nbsp;</th>
				<th class="ag_column">##SUB FORUMS##</th>
				<th class="ag_topic">##Stats##</th>
				<th class="ag_lastpost">##Last post##</th>
			</tr>
		</thead>
		<tbody>
			{foreach from=$sub_forums item=sub}
			<tr id="forum_f{$sub.id}">
				{include file=agora:include/forum_row.tpl forum=$sub}
			</tr>
			{/foreach}
		</tbody>
	</table>
</div>
{/if}

{if $forum.forum_annonce_visible}
<div class="ag_clearer"></div>
<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##annonce title##</span></h2>
</div>
<div class="ag_outerwrap">
	{$forum.forum_annonce}
</div>
<div class="ag_clearer"></div>
{/if}

{if isset($ag_groups) or $agora_config.o_quickjump eq '1' or $access.post_poll or $access.post_topic or $forum.closed}
<div class="ag_forumButtons_wrap">
	<div class="ag_inbox">
		<div class="ag_forumButtons">
			{include file=agora:misc/forum_buttons.tpl}
		</div>
	</div>
</div>
{/if}

<div class="ag_postlinksTop">
	<div class="ag_inbox">
		<div class="ag_bcrumbs">
			{include file=agora:include/bcrumbs.tpl}
		</div>
		<div class="ag_pagelink">
			{include file=agora:include/paginate.tpl}

			<div class="ag_forumTools">
				{include file=agora:tools/forum.tpl}
			</div>
		</div>
	</div>
</div>

<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##Topics in this Forum##</span></h2>
</div>
<div id="vf" class="ag_tablewrap">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
				<th class="ag_leftend">
				{if $agora_config.o_rss_enabled}
					<span>
						<a href="{url task=rss format=feed type=rss fid=$forum.id key=$agora_user.rss_id}" title="##RSS FEED##"><img src="{$root_url}img/icons/rss.png" alt="##RSS FEED##" /></a>
					</span>
				{else}
					<span>&nbsp;</span>
				{/if}
				</th>
				<th class="ag_spacer">&nbsp;</th>
				<th class="ag_column"><a rel="nofollow" href="{if $smarty.get.filter_order eq 't.id' && $smarty.get.filter_order_Dir eq 'desc'}{url task=forum id=$forum.id filter_order=t.id filter_order_Dir=asc}{else}{url task=forum id=$forum.id filter_order=t.id filter_order_Dir=desc}{/if}" title="Click to sort by this column">##Topics##{if $smarty.get.filter_order eq 't.id' && $smarty.get.filter_order_Dir eq 'desc'}<img src="administrator/images/sort_desc.png" alt=""  />{/if}{if $smarty.get.filter_order eq 't.id' && $smarty.get.filter_order_Dir eq 'asc'}<img src="administrator/images/sort_asc.png" alt=""  />{/if}</a></th>
				<th class="ag_topic"><a rel="nofollow" href="{if $smarty.get.filter_order eq 't.num_replies' && $smarty.get.filter_order_Dir eq 'desc'}{url task=forum id=$forum.id filter_order=t.num_replies filter_order_Dir=asc}{else}{url task=forum id=$forum.id filter_order=t.num_replies filter_order_Dir=desc}{/if}" title="Click to sort by this column">##Stats##{if $smarty.get.filter_order eq 't.num_replies' && $smarty.get.filter_order_Dir eq 'desc'}<img src="administrator/images/sort_desc.png" alt=""  />{/if}{if $smarty.get.filter_order eq 't.num_replies' && $smarty.get.filter_order_Dir eq 'asc'}<img src="administrator/images/sort_asc.png" alt=""  />{/if}</a></th>
				<th class="ag_lastpost"><a rel="nofollow" href="{if $smarty.get.filter_order eq 't.last_post' && $smarty.get.filter_order_Dir eq 'desc'}{url task=forum id=$forum.id filter_order=t.last_post filter_order_Dir=asc}{else}{url task=forum id=$forum.id filter_order=t.last_post filter_order_Dir=desc}{/if}" title="Click to sort by this column">##Last post##{if $smarty.get.filter_order eq 't.last_post' && $smarty.get.filter_order_Dir eq 'desc'}<img src="administrator/images/sort_desc.png" alt=""  />{/if}{if $smarty.get.filter_order eq 't.last_post' && $smarty.get.filter_order_Dir eq 'asc'}<img src="administrator/images/sort_asc.png" alt=""  />{/if}</a></th>
			</tr>
		</thead>
		<tbody>
{assign var='ag_adsense' value='1'}
		{foreach name=topics from=$topics key=topic_num item=topic}
			{include file=agora:include/topic_row.tpl}
{if $ag_adsense == 1}
			<tr>
				<td class="ag_adsense" colspan="5">
<div class="ag_adsense">
	{loadModule name=agora_ban}
</div>
{assign var='ag_adsense' value='0'}
				</td>
			</tr>
{/if}
		{foreachelse}
			<tr>
				<td class="ag_column ag_empty_forum" colspan="5">##Empty forum##</td>
			</tr>
		{/foreach}
		</tbody>
	</table>
</div>

<div class="ag_postlinksBottom">
	<div class="ag_inbox">
		<div class="ag_pagelink">
			{include file=agora:include/paginate.tpl}
		</div>
		<div class="ag_bcrumbs">
			{include file=agora:include/bcrumbs.tpl}
		</div>
	</div>
</div>